Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more TS tests for pallet-xcm precompile #3107

Merged
merged 17 commits into from
Jan 2, 2025

Conversation

Agusrodri
Copy link
Contributor

What does it do?

Adds extra typescript tests for pallet-xcm precompile. The new tests mostly check the behavior at the moment of combining two assets, and also using the origin's chain native token to pay for fees.

@Agusrodri Agusrodri added B0-silent Changes should not be mentioned in any release notes D2-notlive PR doesn't change runtime code (so can't be audited) not-breaking Does not need to be mentioned in breaking changes labels Dec 16, 2024
Copy link
Contributor

github-actions bot commented Dec 16, 2024

WASM runtime size check:

Compared to target branch

Moonbase runtime: 2276 KB (no changes) ✅

Moonbeam runtime: 2248 KB (no changes) ✅

Moonriver runtime: 2244 KB (no changes) ✅

Compared to latest release (runtime-3400)

Moonbase runtime: 2276 KB (+248 KB compared to latest release) ⚠️

Moonbeam runtime: 2248 KB (+236 KB compared to latest release) ⚠️

Moonriver runtime: 2244 KB (+232 KB compared to latest release) ⚠️

Copy link
Contributor

github-actions bot commented Dec 16, 2024

Coverage Report

@@                       Coverage Diff                       @@
##           master   agustin-xcm-precompile-tests     +/-   ##
===============================================================
  Coverage   74.49%                         74.49%   0.00%     
  Files         375                            375             
  Lines       95313                          95313             
===============================================================
  Hits        70998                          70998             
  Misses      24315                          24315             
Files Changed Coverage

Coverage generated Thu Jan 2 14:08:04 UTC 2025

@Agusrodri Agusrodri marked this pull request as ready for review December 16, 2024 20:16
Copy link
Contributor

@RomarQ RomarQ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should use the new native foreign assets

@RomarQ RomarQ added B7-runtimenoteworthy Changes should be noted in any runtime-upgrade release notes D3-trivial PR contains trivial changes in a runtime directory that do not require an audit and removed D2-notlive PR doesn't change runtime code (so can't be audited) B0-silent Changes should not be mentioned in any release notes labels Dec 20, 2024
RomarQ
RomarQ previously approved these changes Dec 20, 2024
RomarQ
RomarQ previously approved these changes Dec 20, 2024
gonzamontiel
gonzamontiel previously approved these changes Dec 30, 2024
Copy link
Contributor

@gonzamontiel gonzamontiel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just added a suggestion, but looks great!

@RomarQ RomarQ dismissed stale reviews from gonzamontiel and themself via ea96231 January 2, 2025 08:58
Copy link
Contributor

@gonzamontiel gonzamontiel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@RomarQ RomarQ merged commit 74e484b into master Jan 2, 2025
38 checks passed
@RomarQ RomarQ deleted the agustin-xcm-precompile-tests branch January 2, 2025 14:03
.polkadotJs()
.tx.sudo.sudo(mockHrmpChannelExistanceTx(context, destinationPara, 1000, 102400, 102400));

const alithNonce = (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason to manually fetch Alith's current nonce? The test runs correctly without passing the nonce to createThersTransaction.

functionName: "transferAssetsToPara20",
}),
gasLimit: 500_000n,
nonce: alithNonce,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as the previous comment

[await foreignParaAssetContract.getAddress(), amountToSend],
];

const mockHrmp1000Tx = context
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we mock the channel once at beforeAll instead of every case?

Copy link
Contributor

@pLabarta pLabarta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good, but left some comments.

Edit: Got merged just before writing this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B7-runtimenoteworthy Changes should be noted in any runtime-upgrade release notes D3-trivial PR contains trivial changes in a runtime directory that do not require an audit not-breaking Does not need to be mentioned in breaking changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants